{include file="public/same_header" /}
<style>

    input:-webkit-autofill {
        -webkit-box-shadow: 0 0 0px 1000px white inset;
    }
</style>
    <!-- 右侧的开始 --><!-- hou_yszhguanli 后台的 医生账户管理 -->
    <div class="right_bar jianchajilu add_menber_html">
        {include file="public/main_bread" /}

            <form action="" class="horizontal" method="post" role="form" >
            <div class="data">
                <div class="center">
                    <div class="left">
                        <div class="img_box"  id="img_box">
                            <img src="__STATIC__/index/imgs/doctor.jpg" alt="">
                        </div>
                        <div class="up_box" id="pic">
                            <a>
                                <span>修改头像</span>
                                <input type="file">
                            </a>
                        </div>
                    </div>
                    <div class="right">
                        <ul>
                            <li>
                                <span>用户名：</span>
                                <input type="text" name="username" value="{$list['username'] ?? ''}">
                            </li>
                            <li>
                                <span>姓名：</span>
                                <input type="text" name="name" value="{$list['name'] ?? ''}">
                            </li>
                            <li>
                                <span>所属部门：</span>
                                <select name="depart_id">
                                    {foreach name="departs" item="vo"}
                                    <option value="{$vo['id']}" {if condition="isset($list['depart_id']) &&$list['depart_id'] == $vo['id'] "}selected{/if}>{$vo['department']} </option>
                                    {/foreach}
                                </select>
                            </li>
                            <li>
                                <span>密码设置：</span>
                                <input type="password" name="password" value="">
                            </li>
                            <li class="off_or_on">
                                <span>启用状态：</span>

                                <em class="left" {if condition="isset($list['is_deleted']) && $list['is_deleted'] ==2 "}style="background-color: rgba(204, 204, 204, 0.8);"{/if}>
                                    <i {if condition="isset($list['is_deleted']) && $list['is_deleted'] ==2 "}style="float: right;"{/if}></i>
                                </em>
                                <input type="hidden" value="1" name="is_deleted">
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="save_or_no">
                    <a  class="cirtain">
                        <input type="button" class="ajax-post" value="提交">
                    </a>
                    {include file="public/cancel_list" /}
                </div>
            </div>
                </form>
        </div>
    </div>
    <!-- 右侧的结束 -->
</div>
</div>
{include file="public/footer" /}
<script>


    $(function(){
        var init = 0 ;
        $(".add_menber_html .jcjl_detail .data .right ul li.off_or_on em").click(function(){
            // 点击后再点击  会切换
            var click_btn = "off";
            if(init%2 == 0){
                $(".add_menber_html .jcjl_detail .data .right ul li.off_or_on i").css({"float":"right"});
                $("[name=is_deleted]").val(2);

                $(this).css('background-color','#cccc')

            }else{

                $(".add_menber_html .jcjl_detail .data .right ul li.off_or_on i").css({"float":"left"});
                $("[name=is_deleted]").val(1);
                $(this).css('background-color','#00a29a')
            }
            init++;
        })
    })
</script>


<script src="__STATIC__/common/webuploader/webuploader.min.js"></script>
<script>
    //图片上传
    var uploader = WebUploader.create({
        auto: true,
        swf:'__ASSETS__/lib/webuploader/Uploader.swf',
        server:'{:url("common/upload/uploadFile")}',
        pick:'#pic',
        fileVal:'pic',

        duplicate :true

    })

    uploader.on('uploadSuccess', function(file, response){
        //console.log(response);
        if (response.error == 0) {
            var html = '';
            html += '<img src="'+response.url+'"  width="200px" height="200px" />';
            html += '<input type="hidden" class="body_album" name="avatar" value="'+response.url+'" />';
            $('#img_box').replaceWith(html);
        }
    });



</script>
